<template>
	<detailbox :title="type == 1 ? '重新编辑' : '新增'" @leftclick="close">
		<div slot="right" class="flex_item flex_end">
			<div v-if="type == 1" class="error error_f f12 ml10 flex_start">
				<i class="f14 el-icon-error"></i>
				未通过原因:不要使用自定义编号和版本号，请使用系统自带的编号版本号，以后就不用麻烦了。
			</div>
			<div class="flex_end">
				<el-button type="success" size="small" @click="addFile" v-if="type == 0">添加新增</el-button>
				<el-button v-if="type == 1" type="primary" size="small" plain @click="openDialg('showhistory')">审批历史详情</el-button>
				<el-button type="primary" size="small" @click="submit">提交</el-button>
			</div>
		</div>
		<div slot="bottom" class="flex_start" id="navBar">
			<div style="width:65%;">
				<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
					<el-menu-item index="0">基本信息</el-menu-item>
					<el-menu-item index="1">产品标识基本信息</el-menu-item>
					<el-menu-item index="2">产品基本信息</el-menu-item>
					<el-menu-item index="3">生产标识信息</el-menu-item>
					<el-menu-item index="4">包装标识信息</el-menu-item>
					<el-menu-item index="5">储存或操作信息</el-menu-item>
					<el-menu-item index="6">临床使用尺寸信息</el-menu-item>
					<el-menu-item index="7">版本信息</el-menu-item>
					<el-menu-item index="8">企业联系信息</el-menu-item>
				</el-menu>
			</div>
		</div>
		<el-row id="container">
			<!-- 表单 -->
			<el-col :span="18">
				<div style="margin-top:10px;" v-for="(form, index) in formList" :key="index" :id="'item' + index">
					<basic-container>
						<div class="main_title success_f flex_between">
							<b>管理信息{{ detailId ? '' : `（${index + 1}）` }}</b>
							<el-button @click="delFile(index)" type="danger" size="small" plain v-if="index != 0">删除</el-button>
						</div>
						<el-divider></el-divider>
						<div class="mb20" id="scroll-item0">
							<span class="index_num success_bg">1</span>
							<b class="f14">基础信息</b>
						</div>
						<el-row>
							<el-form size="small" class="scroll-item">
								<el-form-item label="产品UDI管理编号:" required>
									<el-input v-model="form.number" placeholder="数据带入" class="w160 ml10" readonly v-if="form.numberType == 0"></el-input>
									<el-input class="ml10 w160" placeholder="请输入" v-model="form.number" v-if="form.numberType == 1"></el-input>
									<el-popover placement="top-start" title="编号规则:" width="220" trigger="hover">
										<div>
											<p>UDI--------UDI</p>
											<p>xxxx---------年月日(编辑日期，8位)</p>
											<p>xx---------流水号,从01开始</p>
										</div>
										<i slot="reference" class="el-icon-question f18 gray_f ml10"></i>
									</el-popover>
								</el-form-item>
								<el-form-item label="上传医疗器械唯一标识数据库方式:" required>
									<el-select class="w160" placeholder="请选择" v-model="form.isLibrary" filterable>
										<el-option :value="0" label="自动上传"></el-option>
										<el-option :value="1" label="手动上传"></el-option>
									</el-select>
									<!-- <span class="warn_f ml10 f14">注: 产品UDI数据批准完成后自动上传</span> -->
								</el-form-item>
							</el-form>
						</el-row>
						<div class="f14 mb20 scroll-item" id="scroll-item1">产品标识基本信息</div>
						<div class="reviewList">
							<el-form size="small">
								<el-form-item label="医疗器械唯一标识编码体系名称:" required>
									<el-select placeholder="请选择" class="w160" v-model="form.codeSystemName" filterable>
										<el-option :value="0" label="GS1"></el-option>
										<el-option :value="1" label="AHM"></el-option>
										<el-option :value="2" label="MA码"></el-option>
									</el-select>
									<el-popover placement="top-start" title="系统编号:" width="200" trigger="hover">
										<div class="deepgray_f">系统编号</div>
										<i slot="reference" class="el-icon-question f18 gray_f ml10"></i>
									</el-popover>
								</el-form-item>
								<div class="gray_bg" style="padding: 10px;">
									<el-form-item label="最小销售单元产品标识:" required class="mb10"></el-form-item>
									<div class="reviewList gray_bg mb10">
										<el-form-item label="产品标识编码种类:" required>
											<el-select class="w160" placeholder="请选择" v-model="form.levelProTypeIdentCode" filterable>
												<el-option value="GTIN-13" label="GTIN-13"></el-option>
												<el-option value="GTIN-14" label="GTIN-14"></el-option>
											</el-select>
										</el-form-item>
									</div>
									<div class="reviewList ml10 mb20" v-if="form.levelProTypeIdentCode == 'GTIN-14'">
										<el-form size="small" label-position="top">
											<el-row gutter="20">
												<el-col :span="4">
													<el-form-item>
														<div slot="label">
															应用标识符（AI）
															<el-popover placement="top-start" title="应用标识符" width="240" trigger="hover">
																<div>
																	<p>01--全球贸易项目代码(GTIN)</p>
																	<p>
																		更多应用标识符参见
																		<span class="f14 main_co pointer">GB/T16986-2018</span>
																	</p>
																	<p class="f14 red_f pointer">(可点击跳转观看)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select placeholder="请选择" v-model="forms.levelAppIdentCode" filterable>
																<el-option :value="0" label="01"></el-option>
															</el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="4">
													<el-form-item>
														<div slot="label">
															包装指示符
															<el-popover placement="top-start" title="包装指示符" width="240" trigger="hover">
																<div>
																	<p>0--最小包装</p>
																	<p>1 ~ 8-不同级别定量储运包装</p>
																	<p>(全球98%用户在使用)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select placeholder="请选择" v-model="form.levelPackageIndicator" filterable>
																<el-option :value="k - 1" :label="k - 1" v-for="k in 10" :key="k"></el-option>
															</el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="6">
													<el-form-item>
														<div slot="label">
															医疗器械注册人/备案人识别代码:
															<el-popover placement="top-start" title="注册人/备案人识别代码" width="240" trigger="hover">
																<div><p>中国物品编码中心统-分配</p></div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select
																placeholder="请选择"
																v-model="form.levelRecordHolder"
																allow-create
																default-first-option
																filterable
															></el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="4">
													<el-form-item>
														<div slot="label">
															商品项目编码
															<el-popover placement="top-start" title="商品项目编码" width="240" trigger="hover">
																<div><p>不超过12位</p></div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-input class="ml10" v-model="form.fileNumber" placeholder="输入编号"></el-input>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="6">
													<el-form-item>
														<div slot="label">
															校验码
															<el-popover placement="top-start" title="校验码" width="240" trigger="hover">
																<div>
																	<p>使用校验码计算器计算。计算原理</p>
																	<p class="f14 main_co pointer">见GB2904-2008附录B</p>
																	<p class="f14 red_f pointer">(可点击跳转观看)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;">
															<div style="display: flex;align-items: center;">
																<el-input class="ml10" style="width: 130px;" v-model="form.levelCheckCode" placeholder="输入编号"></el-input>
															</div>
														</div>
													</el-form-item>
												</el-col>
											</el-row>
										</el-form>
									</div>
								</div>

								<!-- 最小销售单元中使用单元的数量: -->
								<div class="gray_bg mb10 mt10" style="padding:10px;">
									<el-form-item class="m0" label="最小销售单元中使用单元的数量:" required>
										<el-input class="w160" v-model="form.minUseUnitQty" placeholder="输入"></el-input>
									</el-form-item>
								</div>
								<el-row>
									<el-col :span="12">
										<el-form-item label="产品标识发布日期:" required>
											<el-date-picker class="w160" v-model="form.unitMarkDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="标识载体（多选）:" required>
											<el-select class="w300" placeholder="请选择" multiple v-model="biaoshizaitis">
												<el-option v-for="(item, i) in biaoshizaiti" :key="i" :value="item.value" :label="item.label"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="是否与注册/备案产品标识一致:" required>
											<el-select class="w160" placeholder="请选择" v-model="form.isConsistent">
												<el-option label="否" value="0"></el-option>
												<el-option label="是" value="1"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item class="" label="注册/备案本体标识:" required>
											<el-input class="w160" v-model="form.fileNumber" placeholder="输入" style="width: 90px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>

								<div style="background: #F5F7FA;padding: 20px 10px;">
									<el-row>
										<el-col :span="12">
											<el-form-item label="是否有本体直接标识:" required>
												<el-select class="w160" placeholder="请选择" v-model="form.isOntology">
													<el-option label="否" value="0"></el-option>
													<el-option label="是" value="1"></el-option>
												</el-select>
											</el-form-item>
										</el-col>
										<el-col :span="12" v-if="form.isOntology == 1">
											<el-form-item label="本体产品标识与最小销售单元产品标识是否一致:" required style="background: #F5F7FA; ">
												<el-select class="w160" placeholder="请选择" v-model="form.createUser" filterable>
													<el-option label="否" value="0"></el-option>
													<el-option label="是" value="1"></el-option>
												</el-select>
											</el-form-item>
										</el-col>
									</el-row>
									<!-- 以下是本体产品标识与最小销售单元产品标识是否一致，选择否后 显示的对本体产品标识的编码内容 -->

									<div class="gray_bg">
										<el-form-item label="产品标识编码种类:" required>
											<el-select class="w160" placeholder="请选择" v-model="form.levelProTypeIdentCode" filterable>
												<el-option value="GTIN-13" label="GTIN-13"></el-option>
												<el-option value="GTIN-14" label="GTIN-14"></el-option>
											</el-select>
										</el-form-item>
										<div class="mb10 f14"><b>本体产品标识:</b></div>
										<div class="reviewList ml10 mb20">
											<el-row gutter="20" label-position="top">
												<el-col :span="4">
													<el-form-item>
														<div slot="label">
															应用标识符（AI）
															<el-popover placement="top-start" title="应用标识符" width="240" trigger="hover">
																<div>
																	<p>01--全球贸易项目代码(GTIN)</p>
																	<p>
																		更多应用标识符参见
																		<span class="f14 main_co pointer">GB/T16986-2018</span>
																	</p>
																	<p class="f14 red_f pointer">(可点击跳转观看)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select placeholder="请选择" v-model="forms.levelAppIdentCode" filterable>
																<el-option :value="0" label="01"></el-option>
															</el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="4">
													<el-form-item label-position="top">
														<div slot="label">
															包装指示符
															<el-popover placement="top-start" title="包装指示符" width="240" trigger="hover">
																<div>
																	<p>0--最小包装</p>
																	<p>1 ~ 8-不同级别定量储运包装</p>
																	<p>(全球98%用户在使用)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select placeholder="请选择" v-model="form.levelPackageIndicator" filterable>
																<el-option :value="k - 1" :label="k - 1" v-for="k in 10" :key="k"></el-option>
															</el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="6">
													<el-form-item label-position="top">
														<div slot="label">
															医疗器械注册人/备案人识别代码:
															<el-popover placement="top-start" title="注册人/备案人识别代码" width="240" trigger="hover">
																<div><p>中国物品编码中心统-分配</p></div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select
																placeholder="请选择"
																v-model="form.levelRecordHolder"
																allow-create
																default-first-option
																filterable
															></el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="4">
													<el-form-item label-position="top">
														<div slot="label">
															商品项目编码
															<el-popover placement="top-start" title="商品项目编码" width="240" trigger="hover">
																<div><p>不超过12位</p></div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-input class="ml10" v-model="form.fileNumber" placeholder="输入编号"></el-input>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="6">
													<el-form-item label-position="top">
														<div slot="label">
															校验码
															<el-popover placement="top-start" title="校验码" width="240" trigger="hover">
																<div>
																	<p>使用校验码计算器计算。计算原理</p>
																	<p class="f14 main_co pointer">见GB2904-2008附录B</p>
																	<p class="f14 red_f pointer">(可点击跳转观看)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;">
															<div style="display: flex;align-items: center;">
																<el-input class="ml10" style="width: 130px;" v-model="form.levelCheckCode" placeholder="输入编号"></el-input>
															</div>
														</div>
													</el-form-item>
												</el-col>
											</el-row>
										</div>
									</div>
								</div>
							</el-form>
						</div>

						<div class="f14 mb20 scroll-item" id="scroll-item2" style="margin-top: 40px;">产品基本信息</div>
						<div class="border" style="padding: 10px;">
							<el-form size="small">
								<el-row>
									<el-col :span="12">
										<el-form-item label="产品名称:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="商品名称:" required>
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width: 200px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="规格型号:" required>
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width:100px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="是否为包类/组套类产品:" required>
											<el-date-picker v-model="form.createTime" type="date" placeholder="选择日期" style="width:200px;"></el-date-picker>
										</el-form-item>
									</el-col>
								</el-row>
								<el-form-item label="产品描述:" required>
									<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width:500px;"></el-input>
								</el-form-item>

								<el-row>
									<el-col :span="12">
										<el-form-item label="产品货号或编号:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="原器械目录代码:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="器械类别:" required>
											<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="数据带入" style="width:200px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="分类编码:" required>
											<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="数据带入" style="width:200px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="医疗器械注册人/备案人名称:" required>
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width:100px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="医疗器械注册人/备案人英文名称:" required>
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width:100px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="社会统一信用代码:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="注册证编号或者备案凭证编号:">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width: 100px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>

								<el-row>
									<el-col :span="12">
										<el-form-item label="医保编码:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="产品类别:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>

								<el-form-item label="磁共振（MR）安全相关信息:" required="">
									<el-select placeholder="请选择" v-model="form.createUser" filterable>
										<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
									</el-select>
								</el-form-item>
								<el-row>
									<el-col :span="12">
										<el-form-item label="是否标记为一次性使用:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="最大使用重复次数:" required>
											<el-input class="ml10" v-model="form.fileNumber" placeholder="数据带入" style="width:200px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>

								<el-form-item label="是否为无菌包装:" required>
									<el-select placeholder="请选择" v-model="form.createUser" filterable>
										<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
									</el-select>
								</el-form-item>
								<el-row>
									<el-col :span="12">
										<el-form-item label="使用前是否需要进行灭菌:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="灭菌的方式:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>

								<el-row>
									<el-col :span="12">
										<el-form-item label="医保耗材分类编码:">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width: 200px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="品牌:">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width: 200px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="其他信息的网址链接:">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width: 200px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="退市日期:">
											<el-date-picker v-model="form.createTime" type="date" placeholder="选择日期" style="width:200px;"></el-date-picker>
										</el-form-item>
									</el-col>
								</el-row>
							</el-form>
						</div>

						<div class="f14 mb20 scroll-item" id="scroll-item3" style="margin-top: 40px;">生产标识信息</div>
						<div class="border" style="padding: 10px;">
							<el-form size="small">
								<el-row>
									<el-col :span="10">
										<el-form-item label="生产标识是否包含批号:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="6">
										<el-form-item label="应用标识符（AI）:" required><el-input class="w100" v-model="form.fileNumber" placeholder="数据带入" /></el-form-item>
									</el-col>
									<el-col :span="8">
										<el-form-item label="批号:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>

								<!-- 2 -->
								<el-row>
									<el-col :span="10">
										<el-form-item label="生产标识是否包含生产日期:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="6">
										<el-form-item label="应用标识符（AI）:" required><el-input class="w100" v-model="form.fileNumber" placeholder="数据带入" /></el-form-item>
									</el-col>
									<el-col :span="8">
										<el-form-item label="生产日期:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
								<!-- 3 -->
								<el-row>
									<el-col :span="10">
										<el-form-item label="生产标识是否包含失效日期:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="6">
										<el-form-item label="应用标识符（AI）:" required><el-input class="w100" v-model="form.fileNumber" placeholder="数据带入" /></el-form-item>
									</el-col>
									<el-col :span="8">
										<el-form-item label="失效日期:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
								<!-- 4 -->
								<el-row>
									<el-col :span="10">
										<el-form-item label="生产标识是否包含序列号:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="6">
										<el-form-item label="应用标识符（AI）:" required>
											<el-input class="w100" v-model="form.fileNumber" placeholder="数据带入" style="width:200px;" />
										</el-form-item>
									</el-col>
									<el-col :span="8">
										<el-form-item label="序列号:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
							</el-form>
						</div>

						<div class="f14 mb20 scroll-item" id="scroll-item4" style="margin-top: 40px;">包装标识信息</div>
						<div class="reviewList" style="padding: 10px;">
							<el-form size="small">
								<el-form-item label="产品包装级别:" required style="background: #F5F7FA;padding: 10px;margin-bottom: 0;">
									<el-select placeholder="请选择" v-model="form.createUser" filterable>
										<el-option value="0" label="一级包装"></el-option>
										<el-option value="1" label="二级包装"></el-option>
										<el-option value="2" label="三级包装"></el-option>
									</el-select>
								</el-form-item>
								<!-- 一级包装的显示 -->
								<div>
									<div class="flex_center" style="justify-content: flex-start;margin-top: 20px;">
										<el-popover placement="top-start" title="系统编号:" width="200" trigger="hover">
											<div class="deepgray_f">系统编号</div>
											<i slot="reference" class="el-icon-warning f18 gray_f ml10"></i>
										</el-popover>
										<div style="font-weight: bold;font-size: 14px;color: #606366;margin-left: 10px;">包装产品标识:</div>
									</div>
									<el-form-item label="产品标识编码种类:">
										<el-select placeholder="请选择" v-model="form.createUser" filterable>
											<el-option :value="0" label="GTIN-13"></el-option>
											<el-option :value="1" label="GTIN-14"></el-option>
										</el-select>
									</el-form-item>
									<div class="reviewList ml10">
										<el-form size="small" label-position="top">
											<el-row gutter="20">
												<el-col :span="4">
													<el-form-item>
														<div slot="label">
															应用标识符（AI）
															<el-popover placement="top-start" title="应用标识符" width="240" trigger="hover">
																<div>
																	<p>01--全球贸易项目代码(GTIN)</p>
																	<p>
																		更多应用标识符参见
																		<span class="f14 main_co pointer">GB/T16986-2018</span>
																	</p>
																	<p class="f14 red_f pointer">(可点击跳转观看)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select placeholder="请选择" v-model="forms.ppppp" filterable>
																<el-option :value="0" label="01"></el-option>
															</el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="4">
													<el-form-item>
														<div slot="label">
															包装指示符
															<el-popover placement="top-start" title="包装指示符" width="240" trigger="hover">
																<div>
																	<p>0--最小包装</p>
																	<p>1 ~ 8-不同级别定量储运包装</p>
																	<p>(全球98%用户在使用)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-select placeholder="请选择" v-model="form.createUser" filterable>
																<el-option value="0" label="0"></el-option>
															</el-select>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="6">
													<el-form-item>
														<div slot="label">
															医疗器械注册人/备案人识别代码:
															<el-popover placement="top-start" title="注册人/备案人识别代码" width="240" trigger="hover">
																<div><p>中国物品编码中心统-分配</p></div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-autocomplete
																class="inline-input"
																v-model="form.createUser"
																:fetch-suggestions="querySearch"
																placeholder="请输入内容"
																@select="handleSelect"
															></el-autocomplete>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="4">
													<el-form-item>
														<div slot="label">
															商品项目编码
															<el-popover placement="top-start" title="商品项目编码" width="240" trigger="hover">
																<div><p>不超过12位</p></div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;align-items: center;">
															<el-input class="ml10" v-model="form.fileNumber" placeholder="输入编号"></el-input>
														</div>
													</el-form-item>
												</el-col>
												<el-col :span="6">
													<el-form-item>
														<div slot="label">
															校验码
															<el-popover placement="top-start" title="校验码" width="240" trigger="hover">
																<div>
																	<p>使用校验码计算器计算。计算原理</p>
																	<p class="f14 main_co pointer">见GB2904-2008附录B</p>
																	<p class="f14 red_f pointer">(可点击跳转观看)</p>
																</div>
																<i slot="reference" class="el-icon-question f18 gray_f"></i>
															</el-popover>
														</div>
														<div style="display: flex;">
															<div style="display: flex;align-items: center;">
																<el-input class="ml10" style="width: 130px;" v-model="form.fileNumber" placeholder="输入编号"></el-input>
															</div>
														</div>
													</el-form-item>
												</el-col>
											</el-row>
										</el-form>
									</div>
								</div>
								<!-- 2-3级包装的显示 -->
								<div>
									<el-form-item label="包装内含小一级包装产品标识数量:" required>
										<div class="w300" style="display: flex;align-items: center;">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入编号"></el-input>
											<el-popover placement="top-start" title="系统编号:" width="200" trigger="hover">
												<div class="deepgray_f">系统编号</div>
												<i slot="reference" class="el-icon-warning f18 gray_f ml10"></i>
											</el-popover>
										</div>
									</el-form-item>
									<el-form-item label="包装内含小一级包装产品标识是否一致:" required>
										<div class="w300" style="display: flex;align-items: center;">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option value="0" label="是"></el-option>
												<el-option value="1" label="否"></el-option>
											</el-select>
										</div>
									</el-form-item>
									<div>
										<div class="flex_center" style="justify-content: flex-start;margin-bottom: 10px;">
											<el-popover placement="top-start" title="系统编号:" width="200" trigger="hover">
												<div class="deepgray_f">系统编号</div>
												<i slot="reference" class="el-icon-warning f18 gray_f ml10"></i>
											</el-popover>
											<div style="font-weight: bold;font-size: 14px;color: #606366;margin-left: 10px;">包装产品标识:</div>
											<el-button type="primary" plain size="mini" icon="el-icon-plus">增加</el-button>
										</div>
										<el-form-item label="产品标识编码种类:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option :value="0" label="GTIN-13"></el-option>
												<el-option :value="1" label="GTIN-14"></el-option>
											</el-select>
										</el-form-item>
										<div class="reviewList">
											<el-form size="small" label-position="top">
												<el-row gutter="20">
													<el-col :span="4">
														<el-form-item>
															<div slot="label">
																应用标识符（AI）
																<el-popover placement="top-start" title="应用标识符" width="240" trigger="hover">
																	<div>
																		<p>01--全球贸易项目代码(GTIN)</p>
																		<p>
																			更多应用标识符参见
																			<span class="f14 main_co pointer">GB/T16986-2018</span>
																		</p>
																		<p class="f14 red_f pointer">(可点击跳转观看)</p>
																	</div>
																	<i slot="reference" class="el-icon-question f18 gray_f"></i>
																</el-popover>
															</div>
															<div style="display: flex;align-items: center;">
																<el-select placeholder="请选择" v-model="forms.ppppp" filterable>
																	<el-option :value="0" label="01"></el-option>
																</el-select>
															</div>
														</el-form-item>
													</el-col>
													<el-col :span="4">
														<el-form-item>
															<div slot="label">
																包装指示符
																<el-popover placement="top-start" title="包装指示符" width="240" trigger="hover">
																	<div>
																		<p>0--最小包装</p>
																		<p>1 ~ 8-不同级别定量储运包装</p>
																		<p>(全球98%用户在使用)</p>
																	</div>
																	<i slot="reference" class="el-icon-question f18 gray_f"></i>
																</el-popover>
															</div>
															<div style="display: flex;align-items: center;">
																<el-select placeholder="请选择" v-model="form.createUser" filterable>
																	<el-option value="0" label="0"></el-option>
																</el-select>
															</div>
														</el-form-item>
													</el-col>
													<el-col :span="6">
														<el-form-item>
															<div slot="label">
																医疗器械注册人/备案人识别代码:
																<el-popover placement="top-start" title="注册人/备案人识别代码" width="240" trigger="hover">
																	<div><p>中国物品编码中心统-分配</p></div>
																	<i slot="reference" class="el-icon-question f18 gray_f"></i>
																</el-popover>
															</div>
															<div style="display: flex;align-items: center;">
																<el-autocomplete
																	class="inline-input"
																	v-model="form.createUser"
																	:fetch-suggestions="querySearch"
																	placeholder="请输入内容"
																	@select="handleSelect"
																></el-autocomplete>
															</div>
														</el-form-item>
													</el-col>
													<el-col :span="4">
														<el-form-item>
															<div slot="label">
																商品项目编码
																<el-popover placement="top-start" title="商品项目编码" width="240" trigger="hover">
																	<div><p>不超过12位</p></div>
																	<i slot="reference" class="el-icon-question f18 gray_f"></i>
																</el-popover>
															</div>
															<div style="display: flex;align-items: center;">
																<el-input class="ml10" v-model="form.fileNumber" placeholder="输入编号"></el-input>
															</div>
														</el-form-item>
													</el-col>
													<el-col :span="6">
														<el-form-item>
															<div slot="label">
																校验码
																<el-popover placement="top-start" title="校验码" width="240" trigger="hover">
																	<div>
																		<p>使用校验码计算器计算。计算原理</p>
																		<p class="f14 main_co pointer">见GB2904-2008附录B</p>
																		<p class="f14 red_f pointer">(可点击跳转观看)</p>
																	</div>
																	<i slot="reference" class="el-icon-question f18 gray_f"></i>
																</el-popover>
															</div>
															<div style="display: flex;">
																<div style="display: flex;align-items: center;">
																	<el-input class="ml10" style="width: 130px;" v-model="form.fileNumber" placeholder="输入编号"></el-input>
																</div>
															</div>
														</el-form-item>
													</el-col>
												</el-row>
											</el-form>
										</div>
									</div>
								</div>
							</el-form>
						</div>

						<div class="f14 mb20 scroll-item" id="scroll-item5" style="margin-top: 40px;">储存或操作信息</div>
						<div class="border" style="padding: 10px;">
							<el-form size="small">
								<el-row>
									<el-col :span="12">
										<el-form-item label="储存或操作条件:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="最低值:">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width: 90px;"></el-input>
											<el-popover placement="top-start" title="最低值:" width="200" trigger="hover">
												<div class="deepgray_f">最低值</div>
												<i slot="reference" class="el-icon-warning f18 gray_f ml10"></i>
											</el-popover>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="最高值:">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width:100px;"></el-input>
											<el-popover placement="top-start" title="最高值:" width="200" trigger="hover">
												<div class="deepgray_f">最高值</div>
												<i slot="reference" class="el-icon-warning f18 gray_f ml10"></i>
											</el-popover>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="计量单位:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
								<el-form-item label="特殊储存或操作条件:">
									<el-select placeholder="请选择" v-model="form.createUser" filterable>
										<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
									</el-select>
								</el-form-item>
							</el-form>
						</div>

						<div class="f14 mb20 scroll-item" id="scroll-item6" style="margin-top: 40px;">临床使用尺寸信息</div>
						<div class="border" style="padding: 10px;">
							<el-form size="small">
								<el-row>
									<el-col :span="12">
										<el-form-item label="临床使用尺寸类型:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="尺寸值:">
											<el-input class="ml10" v-model="form.fileNumber" placeholder="输入" style="width: 90px;"></el-input>
											<el-popover placement="top-start" title="最低值:" width="200" trigger="hover">
												<div class="deepgray_f">最低值</div>
												<i slot="reference" class="el-icon-warning f18 gray_f ml10"></i>
											</el-popover>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="尺寸单位:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="特殊尺寸说明:">
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
							</el-form>
						</div>

						<div class="f14 mb20 scroll-item" id="scroll-item7" style="margin-top: 40px;">版本信息</div>
						<div class="border" style="padding: 10px;">
							<el-form size="small">
								<el-row>
									<el-col :span="12">
										<el-form-item label="主键编号:">
											<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="系统产生" style="width:160px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="公开的版本号:">
											<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="系统产生" style="width: 160px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row>
									<el-col :span="12">
										<el-form-item label="版本的发布时间:">
											<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="系统产生" style="width: 160px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="版本的状态:">
											<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="系统产生" style="width: 160px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
								<el-form-item label="变更备注:">
									<el-input class="ml10" v-model="form.fileNumber" placeholder="请输入" style="width: 500px;"></el-input>
								</el-form-item>
							</el-form>
						</div>

						<div class="f14 mb20 scroll-item" id="scroll-item8" style="margin-top: 40px;">企业联系信息</div>
						<div class="border" style="padding: 10px;">
							<el-form size="small">
								<el-row>
									<el-col :span="12">
										<el-form-item label="联系人邮箱:">
											<el-input class="ml10" type="email" v-model="form.fileNumber" placeholder="请输入" style="width:240px;"></el-input>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="联系人电话:">
											<el-input class="ml10" type="phone" v-model="form.fileNumber" placeholder="请输入" style="width: 240px;"></el-input>
										</el-form-item>
									</el-col>
								</el-row>
								<el-form-item label="联系人传真:">
									<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="系统产生" style="width: 240px;"></el-input>
								</el-form-item>
								<el-row>
									<el-col :span="12">
										<el-form-item label="管理部门:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="负责人:" required>
											<el-select placeholder="请选择" v-model="form.createUser" filterable>
												<el-option v-for="(item, i) in memberOption" :key="i" :value="item.id" :label="item.name"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
								<el-form-item label="编制部门:">
									<el-input class="ml10" readonly v-model="form.fileNumber" placeholder="系统产生" style="width: 500px;"></el-input>
								</el-form-item>
							</el-form>
						</div>
						<div style="margin-bottom: 10px;"><creat-file :form="form"></creat-file></div>
					</basic-container>
				</div>
			</el-col>
			<el-col :span="6" style="margin-top:10px;"><creat-flow ref="creatFlow" :formList="formList"></creat-flow></el-col>
		</el-row>
		<steps ref="steps" @close="success()"></steps>
		<confirm
			ref="confirm"
			@close="save()"
			type="1"
			:guifanFilesProcessRecordList="guifanFilesProcessRecordList"
			:systemGuifanFilesProcessList="systemGuifanFilesProcessList"
		></confirm>
		<showhistory ref="showhistory" type="1" :guifanFilesProcessRecordList="guifanFilesProcessRecordList"></showhistory>
		<!-- 选择文件 -->
	</detailbox>
</template>

<script>
// const moment = require('moment');
import confirm from './confirm.vue';
import { savefiles, getguifanDetail, update, getguifanList } from '@/api/myapi/tixiwenjian';
export default {
	props: {
		detailId: ''
	},
	components: {
		confirm
	},
	data() {
		return {
			activeIndex: '0',
			biaoshizaitis: [],
			GTIN: 13,
			forms: {
				ppppp: 0
			},
			type: 0,
			system: 'productcleanprocess',
			deptOption: [],
			memberOption: [],
			checked: false,
			showpreview: false,
			tableData: [],
			developmentplanList: [],
			formList: [
				{
					productName: '', //名称
					productNumber: '', //编号
					productSku: '', //	规格型号
					sampleQty: '', //留样数量
					sampleDate: '', // 留样日期
					examineDate: '2021-04-02', //  检验日期
					invalidDate: '',
					number: '',
					batchNumber: '',
					cleanType: 0,
					numberType: 0,
					manageUserId: '',
					manageUserName: '',
					createDeptName: '',
					manageDeptId: '',
					manageDeptName: '',
					retentionPeriod: '', // 记录保留期限
					guifanFilesIds: '',
					jiluFilesIds: '',
					deviceList: [], //   设备列表
					outsourcingList: [], //外包服务列表
					productList: [], //原材料列表
					softwareList: [], //计算机应用软件列表
					jiluFileList: [],
					guifanFileList: []
				}
			],
			defaultCheckedKeys: [],
			oldguifanFilesProcessRecordList: [],
			guifanFilesProcessRecordList: [],
			systemGuifanFilesProcessList: [],
			restaurants: [],
			biaoshizaiti: [
				{
					label: '一维码',
					value: 0
				},
				{
					label: '二维码',
					value: 1
				},
				{
					label: 'FRFID',
					value: 2
				},
				{
					label: '其他',
					value: 3
				}
			]
		};
	},
	created() {
		if (this.detailId) {
			this.getDetail();
		} else {
			this.findTypeByProcessType();
		}
		this.getdeptlist();
		this.getdevelopmentplanList();
		window.addEventListener('scroll', this.onScroll, true);
	},
	methods: {
		onScroll(e) {
			let scrollItems = document.querySelectorAll('.scroll-item');
			for (let i = scrollItems.length - 1; i >= 0; i--) {
				// 判断滚动条滚动距离是否大于当前滚动项可滚动距离
				let judge = e.target.scrollTop >= scrollItems[i].offsetTop - scrollItems[0].offsetTop;
				if (judge) {
					this.activeIndex = i.toString();
					break;
				}
			}
		},
		handleSelect(index) {
			this.activeIndex = index;
			let scrollItems = document.querySelectorAll('.scroll-item');
		},
		getDetail() {
			getguifanDetail(
				{
					id: this.detailId
				},
				this.system
			).then(({ data }) => {
				console.log(data);
				if (data.success) {
					this.formList = [data.data];
					data.data.isOnlineReview == 1 ? (this.isOnlineReview = true) : (this.isOnlineReview = false);
					this.oldguifanFilesProcessRecordList = data.data.processRecordList;
					data.data.processRecordList.forEach(item => {
						if (item.type == 1) {
							this.shenhe.userId = item.userId;
							this.shenhe.deptId = item.deptId;
						} else if (item.type == 2) {
							this.tableData.push({
								deptName: item.createDeptName,
								userName: item.createUserName,
								userId: item.userId,
								deptId: item.deptId
							});
						} else if (item.type == 4) {
							this.pizhun.userId = item.userId;
						}
					});
				}
			});
		},
		close() {
			this.$emit('close');
		},
		// 产品管理
		getdevelopmentplanList() {
			getguifanList(
				{
					current: 1,
					size: 10000,
					isTongguo: 1
				},
				'purchaseplanprocess'
			).then(({ data }) => {
				console.log(data);
				if (data && data.success) {
					this.developmentplanList = data.data.records;
				}
			});
		},
		getMemberOption(val, index) {
			let dept = this.$refs.newdept[index].getCheckedNodes();
			this.formList[index].manageDeptName = dept[0].label;
			this.formList[index].manageDeptId = dept[0].value;
			this.formList[index].manageUserId = '';
			this.formList[index].manageUserName = '';
			getuserByDept({
				deptId: val
			}).then(({ data }) => {
				if (data && data.success) {
					this.memberOption = data.data;
				}
			});
		},
		submit() {
			let systemGuifanFilesProcessList = [];
			let guifanFilesProcessRecordList = this.$refs.creatFlow.guifanFilesProcessRecordList;
			let isOnlineReview = this.$refs.creatFlow.isOnlineReview;
			for (let i = 0; i <= guifanFilesProcessRecordList.length - 1; i++) {
				let item = guifanFilesProcessRecordList[i];
				if (item.type == 1 && !item.userId) {
					this.$message.error('请选择审核人员');
					return;
				}
				if (item.type == 4 && !item.userId) {
					this.$message.error('请选择批准人员');
					return;
				}
				if (isOnlineReview && item.type == 3 && !item.userId) {
					this.$message.error('请选择记录责任人');
					return;
				}
			}
			for (let i = 0; i < this.formList.length; i++) {
				let item = this.formList[i];
				let arr = [
					{
						value: item.number,
						tips: '请补充产品UDI管理编号'
					},
					{
						value: item.cleanType != 0 ? item.productName : true,
						tips: '请选择名称'
					},
					{
						value: item.cleanType != 0 ? item.productSku : true,
						tips: '请选择规格型号'
					},
					{
						value: item.cleanType != 0 ? item.productNumber : true,
						tips: '请选择编号'
					},
					{
						value: item.manageDeptId,
						tips: '请选择管理部门'
					},
					{
						value: item.manageUserId,
						tips: '请选择负责人'
					},
					{
						value: item.jiluFilesIds,
						tips: '请添加记录文件'
					},
					{
						value: item.retentionPeriod,
						tips: '请输入记录保留期限'
					}
				];
				for (let j = 0; j < arr.length; j++) {
					if (!arr[j].value) {
						this.$message.error(arr[j].tips);
						return;
					}
				}
				item.createDeptName = this.userInfo.deptName;
				item.createUserName = this.userInfo.user_name;
				item.createUserId = this.userInfo.user_id;
				item.createDeptId = this.userInfo.dept_id;
				systemGuifanFilesProcessList.push({
					...item,
					processRecordList: guifanFilesProcessRecordList
				});
			}
			this.systemGuifanFilesProcessList = systemGuifanFilesProcessList;
			this.guifanFilesProcessRecordList = guifanFilesProcessRecordList;
			console.log(this.systemGuifanFilesProcessList);
			console.log(this.guifanFilesProcessRecordList);
			this.openDialg('confirm');
		},
		// 保存
		save() {
			if (this.detailId) {
				console.log(JSON.stringify(this.systemGuifanFilesProcessList));
				update(this.systemGuifanFilesProcessList, this.system).then(({ data }) => {
					if (data.success) {
						this.$message.success('提交成功');
						this.nowdate = this.dateFormat(new Date());
						this.openDialg('steps');
					}
				});
			} else {
				// console.log(this.systemGuifanFilesProcessList)
				savefiles(this.systemGuifanFilesProcessList, this.system).then(({ data }) => {
					if (data.success) {
						this.$message.success('提交成功');
						this.nowdate = this.dateFormat(new Date());
						this.openDialg('steps');
					}
				});
			}
		},
		success() {
			this.$emit('success');
		},
		// 发放的文件
		addFile() {
			this.formList.push({
				nu: 1,
				isUser: 0,
				manageUserId: '',
				manageUserName: '',
				createDeptName: '',
				manageDeptId: '',
				manageDeptName: '',
				retentionPeriod: '', // 记录保留期限
				guifanFilesIds: '',
				jiluFilesIds: '',
				jiluFileList: [],
				guifanFileList: [],
				skuList: [],
				deviceList: []
			});
			let index = this.formList.length - 1;
			setTimeout(() => {
				let document = window.parent.document.getElementById(`item${index}`);
				document.scrollIntoView({ behavior: 'smooth' });
			}, 100);
		},
		delFile(i) {
			console.log(i);
			this.formList.splice(i, 1);
		},
		// 签名
		addSign() {
			this.isOnlineReview = true;
			this.signList.push({});
		},
		delSign(i) {
			this.signList.splice(i, 1);
			if (this.signList.length == 0) this.isOnlineReview = false;
		}
	}
};
</script>

<style scoped="scoped" lang="scss">
.btn_ {
	width: 90px;
	height: 40px;
	line-height: 40px;
	text-align: center;
	background: #ebf6ee;
	border: 1px solid #36a759;
	opacity: 1;
	border-radius: 3px;
	font-size: 14px;
	font-family: Microsoft YaHei;
	font-weight: 400;
	line-height: 14px;
	color: #36a759 !important;
}

.error {
	background-color: #fceeec;
	border: 1px solid #f9dcd9;
	padding: 6px 10px;
	border-radius: 2px;
}

.border {
	border: 1px dashed #c0c6cc;
	border-radius: 4px;
	line-height: 32px;
	padding: 0 10px;
}
.reviewList {
	background: #ffffff;
	border: 1px dashed #c0c6cc;
	padding: 20px 20px 0 20px;
}
</style>
